﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.NetworkService.Behaviors.Interfaces;
using System.Web;
using System.ComponentModel.DataAnnotations;


namespace Domain.NetworkService
{
    [Serializable]
    public struct EchoSpecificParameters
    {
        public int size;
        public bool dontFragment;
        public int responseTime;
        public int ttl;
    }
    [Serializable]
    public class EchoDescription : Description, IDescription
    {
        private EchoSpecificParameters EchoParameters = new EchoSpecificParameters();
        public int Size
        {
            get { return EchoParameters.size; }
            set { EchoParameters.size = value; }
        }
        public bool DontFragment
        {
            get { return EchoParameters.dontFragment; }
            set { EchoParameters.dontFragment = value; }
        }
        public int ResponseTime
        {
            get { return EchoParameters.responseTime; }
            set { EchoParameters.responseTime = value; }
        }
        public int Ttl
        {
            get { return EchoParameters.ttl; }
            set { EchoParameters.ttl = value; }
        }

        public override string ToString()
        {
            return String.Format("{0} [S:{1} DF:{2} RT:{3} Ttl:{4}]", Timeout,
                                                                 EchoParameters.size,
                                                                 EchoParameters.dontFragment,
                                                                 EchoParameters.responseTime,
                                                                 EchoParameters.ttl);
        }
    }
}
